package com.kong.multids.controller;

import com.kong.multids.domain.Animal;
import com.kong.multids.model.Cat;
import com.kong.multids.model.Dog;
import com.kong.multids.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author gedachao
 * @description
 * @date 2020/5/30 16:44
 */
@RestController
@ResponseBody
public class Controller1 {

    @Autowired
    Service1Impl service1;

    @Autowired
    Service2Impl service2;

    @Autowired
    Service3Impl service3;

    @Autowired
    Service4Impl service4;

    @Autowired
    Service5Impl service5;


    @RequestMapping("/m1")
    public List<Cat> m1(){
        return service1.getCats();
    }
    @RequestMapping("/m2")
    public List<Cat> m2(){
        return service2.getCats();
    }

    @RequestMapping("/m3")
    public List<Dog> m3(){
        return service3.getDogs();
    }

    @RequestMapping("/m4")
    public Animal m4(){
        return service4.getAll();
    }

    @RequestMapping("/m5")
    public void m5(){
        service5.add();
    }


}
